Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

Disable automatic otel instrumentation that is conflicting with ours#361

Closed
jhaynie wants to merge 1 commit intomainfrom
otel-disable-py
Closed

Disable automatic otel instrumentation that is conflicting with ours#361
jhaynie wants to merge 1 commit intomainfrom
otel-disable-py

Conversation

@jhaynie
Copy link
Copy Markdown
Member

@jhaynie jhaynie commented May 28, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Improved compatibility with Python projects by disabling conflicting automatic instrumentation, ensuring smoother operation for users working with Python-based environments.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 28, 2025

Walkthrough

A conditional check was added in the environment variable setup of the CreateRunProjectCmd function. When the project's bundler language is Python, two specific environment variables are appended to the command's environment to disable certain Python instrumentations. No changes were made to exported or public entity declarations.

Changes

File(s) Change Summary
internal/dev/dev.go Added conditional logic in CreateRunProjectCmd to set environment variables for Python bundler.

Poem

In the warren of code, a check hops in,
If Python’s the path, let tracing not begin.
Two envs set quietly, to keep the run clean,
JavaScript untouched, as it’s always been.
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5b13734 and f255fda.

📒 Files selected for processing (1)
  • internal/dev/dev.go (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
internal/dev/dev.go (1)
internal/project/project.go (2)
  • Project (145-154)
  • Bundler (461-470)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Test CLI Upgrade Path (windows-latest)
🔇 Additional comments (1)
internal/dev/dev.go (1)

126-130:

Details

❓ Verification inconclusive

Good implementation following existing patterns, but verify the environment variable specifics.

The conditional logic follows the established pattern for language-specific environment setup. The purpose is clear from the comment and aligns with the PR objective to disable conflicting OpenTelemetry instrumentation.

However, please verify that:

  1. The environment variable names are correct for the intended libraries
  2. The hardcoded list "langchain,openai" covers all necessary instrumentations
  3. This change doesn't break existing Python projects that might depend on these instrumentations

🏁 Script executed:

#!/bin/bash
# Verify the correct environment variable names for disabling Python OTEL instrumentation
rg -A 3 -B 3 "TRACELOOP_TRACE_CONTENT|OTEL_PYTHON_DISABLED_INSTRUMENTATIONS" --type py

Length of output: 237


🌐 Web query:

What are the correct environment variable names for disabling OpenTelemetry Python instrumentation, specifically for traceloop and the OTEL_PYTHON_DISABLED_INSTRUMENTATIONS setting?

💡 Result:

To disable specific instrumentations in OpenTelemetry Python, you can use the OTEL_PYTHON_DISABLED_INSTRUMENTATIONS environment variable. This variable accepts a comma-separated list of package names corresponding to the instrumentations you wish to exclude. For example, to disable instrumentations for redis, kafka-python, and grpc, you would set:

export OTEL_PYTHON_DISABLED_INSTRUMENTATIONS=redis,kafka-python,grpc

This setting ensures that the OpenTelemetry Python agent does not instrument these specific packages, preventing the collection of telemetry data from them. (opentelemetry.io)

Regarding the TRACELOOP_TELEMETRY environment variable, it is used to control telemetry data collection for the Traceloop SDK, which is separate from OpenTelemetry. To opt out of telemetry collection in Traceloop, you can set:

export TRACELOOP_TELEMETRY=FALSE

This setting disables the collection of anonymous usage information by Traceloop. (traceloop.com)

It's important to note that TRACELOOP_TELEMETRY does not affect OpenTelemetry's telemetry data collection. To disable telemetry in OpenTelemetry Python, you would typically set the OTEL_SDK_DISABLED environment variable to true:

export OTEL_SDK_DISABLED=true

This setting disables the OpenTelemetry SDK for all signals, effectively turning off telemetry data collection. (opentelemetry.io)

In summary, to disable specific instrumentations in OpenTelemetry Python, use the OTEL_PYTHON_DISABLED_INSTRUMENTATIONS environment variable. To disable telemetry data collection in Traceloop, use the TRACELOOP_TELEMETRY environment variable. To disable all telemetry in OpenTelemetry Python, use the OTEL_SDK_DISABLED environment variable.

Citations:


Verify Python OTEL environment variables and instrumentation names

The Python-specific branch aligns with the existing pattern for disabling automatic instrumentation, but please double-check the following before merging:

  • The Traceloop environment variable. Upstream docs reference TRACELOOP_TELEMETRY=FALSE to opt out of Traceloop SDK telemetry, not TRACELOOP_TRACE_CONTENT.
  • The OpenTelemetry instrumentation names. Ensure langchain,openai exactly match the package names used by the OpenTelemetry Python agent.
  • Run manual tests against existing Python projects to confirm these settings don’t inadvertently disable needed instrumentation.
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@jhaynie jhaynie requested a review from jsw324 May 28, 2025 20:17
@jhaynie jhaynie marked this pull request as draft May 29, 2025 20:36
@jhaynie
Copy link
Copy Markdown
Member Author

jhaynie commented May 30, 2025

going to close this for now since we found the root issue unrelated to this.

@jhaynie jhaynie closed this May 30, 2025
@jhaynie jhaynie deleted the otel-disable-py branch May 30, 2025 02:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant